RAIS  3.2
C:/Projekte/RAIS/common/DynamicMaskFilter.cs
Go to the documentation of this file.
00001 
00028 using System;
00029 using System.Data;
00030 using System.Collections.Generic;
00031 using System.Text;
00032 using RAIS.Common.TableManagement;
00033 
00034 namespace RAIS.Common.DynamicMaskManagement
00035 {
00039         public class DynamicMaskFilter: DBObject
00040         {
00041                 //*********************************************************************
00042                 #region Enumerators
00043                 public enum FilterType
00044                 {
00045                         Lookup,
00046                         DatesRage
00047                 }
00048                 #endregion
00049                 //*********************************************************************
00050                 #region Fields
00051                 //Field field;
00052                 Table table;
00053                 string queryName;
00054                 int order;
00055                 bool visibleOnForm;
00056                 bool useInQuery;
00057                 int orderInQuery = 0;
00058                 FilterType type;
00059                 Dictionary<string, DynamicMaskFilter> parentFilters = new Dictionary<string,DynamicMaskFilter>();
00060                 #endregion
00061                 //*********************************************************************
00062                 #region Properties
00063                 //public Field Field
00064                 //{
00065                 //    get { return this.field; }
00066                 //    set { this.field = value; }
00067                 //}
00068 
00072                 public Table Table
00073                 {
00074                         get { return table; }
00075                         set { table = value; }
00076                 }
00080                 public string QueryName
00081                 {
00082                         get { return this.queryName; }
00083                         set { this.queryName = value; }
00084                 }
00088                 public int Order
00089                 {
00090                         get { return this.order; }
00091                         set { this.order = value; }
00092                 }
00096                 public bool VisibleOnForm
00097                 {
00098                         get { return this.visibleOnForm; }
00099                         set { this.visibleOnForm = value; }
00100                 }
00104                 public bool UseInQuery
00105                 {
00106                         get { return this.useInQuery; }
00107                         set { this.useInQuery = value; }
00108                 }
00112                 public int OrderInQuery
00113                 {
00114                         get { return this.orderInQuery; }
00115                         set { this.orderInQuery = value; }
00116                 }
00120                 public FilterType Type
00121                 {
00122                         get { return this.type; }
00123                 }
00127                 public Dictionary<string, DynamicMaskFilter> ParentFilters
00128                 {
00129                         get { return this.parentFilters; }
00130                         set { this.parentFilters = value; }
00131                 }
00135                 public string DBObjectName
00136                 {
00137                         get 
00138                         {
00139                                 string name = string.Empty;
00140                                 if (!string.IsNullOrEmpty(this.queryName))
00141                                 {
00142                                         name = this.queryName;
00143                                 }
00144                                 else
00145                                 {
00146                                         if (this.table != null)
00147                                                 name = this.table.Name;
00148                                 }
00149                                 return name;
00150                         }
00151                 }
00152                 #endregion
00153                 //*********************************************************************
00154                 #region Constructors
00155                 public DynamicMaskFilter()
00156                 { }
00157                 public DynamicMaskFilter(IDataRecord record)
00158                 {
00159                         this.id = (int)record["PK Dynamic Mask Filter ID"];
00160                         this.name = record["Dynamic Mask Filter Name"].ToString();
00161                         //this.field = new Field();
00162                         //if (!(record["FK Field ID"] is DBNull))
00163                         //    this.field.ID = (int)record["FK Field ID"];
00164                         this.table = new Table();
00165                         if (!(record["FK Table ID"] is DBNull))
00166                                 this.table.ID = (int)record["FK Table ID"];
00167                         this.queryName = record["Query Name"].ToString();
00168                         this.order = (int)record["Order"];
00169                         this.visibleOnForm = ((byte)record["Visible On Form"] == 0) ? false : true;
00170                         this.useInQuery = ((byte)record["Use In Query"] == 0) ? false : true;
00171                         this.orderInQuery = (int)record["Order In Query"];
00172                         this.type = (this.name == Constants.DATES_RANGE_FILTER_NAME) ? FilterType.DatesRage : FilterType.Lookup;
00173                 }
00174                 #endregion
00175         }
00176 }